<?php

/**
 * event actions.
 *
 * @package    Nika
 * @subpackage event
 * @author     Alexey Shapran (alexey.shapran@gmail.com)
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class commentComponents extends sfComponents
{
	public function executeShowlist(sfWebRequest $request)
	{
		$this->comments = Comment::viewcomments($this->entity_id, $this->entity_type);

	if(!$this->getUser()->getAttribute('form'))
			$this->form = new CommentForm();
		else
		{
			$this->form = $this->getUser()->getAttribute('form');
			$this->getUser()->setAttribute('form', NULL);
		}
		
		if(!$this->getUser()->getAttribute('urgform'))
			$this->unregform = new UnregCommentForm();
		else 
		{
			$this->unregform = $this->getUser()->getAttribute('urgform');
			$this->getUser()->setAttribute('urgform', NULL);
		}
		
	}
}